<?php
$connection = ssh2_connect('208.74.72.210', 22);

/* Notify the user if the server terminates the connection */
function my_ssh_disconnect($reason, $message, $language) {
  printf("Server disconnected with reason code [%d] and message: %s\n",
         $reason, $message);
}

$methods = array(
  'kex' => 'diffie-hellman-group1-sha1',
  'client_to_server' => array(
    'crypt' => '3des-cbc',
    'comp' => 'none'),
  'server_to_client' => array(
    'crypt' => 'aes256-cbc,aes192-cbc,aes128-cbc',
    'comp' => 'none'));

$callbacks = array('disconnect' => 'my_ssh_disconnect');

$connection = ssh2_connect('208.74.72.210', 22, $methods, $callbacks);
if (!$connection) die('Connection failed');


//ssh2_auth_password($connection, 'ens', 'nnct@ssct@');
//
//$tunnel = ssh2_tunnel($connection, 'DESTINATION IP', 3307);
//
//$db = new mysqli_connect('127.0.0.1', '', 'DB_PASSWORD', 
//                         'dbname', 3307, $tunnel)
//    or die ('Fail: '.mysql_error());
//
//
//$dbHost = "127.0.0.1";        //Location Of Database usually its localhost
//$dbUser = "ens";            //Database User Name
//$dbPass = "ens1234";            //Database Password
//$dbDatabase = "wholesale";       //Database Name
// 
//$db = mysqli_connect("$dbHost", "$dbUser", "$dbPass") or die ("Error connecting to database.");
//mysql_select_db("$dbDatabase", $db) or die ("Couldn't select the database.");
// 
//# This function will send an imitation 404 page if the user
//# types in this files filename into the address bar.
//# only files connecting with in the same directory as this
//# file will be able to use it as well.
//function send_404()
//{
//    header('HTTP/1.x 404 Not Found');
//    print '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'."<br/>".
//    '<html><head>'."<br/>".
//    '<title>404 Not Found</title>'."<br/>".
//    '</head><body>'."<br/>".
//    '<h1>Not Found</h1>'."<br/>".
//    '<p>The requested URL '.
//    str_replace(strstr($_SERVER['REQUEST_URI'], '?'), '', $_SERVER['REQUEST_URI']).
//    ' was not found on this server.</p>'."<br/>".
//    '</body></html>'."<br/>";
//    exit;
//}
// 
//# In any file you want to connect to the database,
//# and in this case we will name this file db.php
//# just add this line of php code (without the pound sign):
//# include"db.php";